<?php

namespace Mlym\CodeGeneration\Middleware\Api;

use Mlym\CodeGeneration\Middleware\Bean\MiddlewareBean;

class Validate
{
    protected $message = '';
    protected $data;

    public function __construct(MiddlewareBean $data)
    {
        $this->data = $data;
    }

    public function validate()
    {
        if (empty($this->data->getModule()->getName())){
            $this->message = 'module->name is empty';
            return false;
        }
        return true;
    }

    /**
     * @return string
     */
    public function getMessage(): string
    {
        return $this->message;
    }


}